#ifndef NETWORKTHREAD_HPP
#define NETWORKTHREAD_HPP
#include <QObject>
#include <QThread>
#include "AsyncServer.h"
#include "ExampleClient.h"
#include "room.hpp"

class netWorkObj:public QObject{
    Q_OBJECT
public:
    netWorkObj():QObject(nullptr),async_server("192.168.43.20", 8080, 10){
        this->run();
    }
    void run(){
        async_server.EventLoop();
    }
private:
    AsyncServer<ExampleClient> async_server;
};

class netWorkThread:public QThread{
public:
    netWorkThread(QObject *parent):QThread(parent){

    }
    void run(){
        netWorkObj obj;
        obj.moveToThread(this);
        exec();
    }
};

#endif // NETWORKTHREAD_HPP
